Two-dimensional variable length coding (2D-VLC) includes collecting or assuming the statistics of two dimensional block transform coefficient events that are each a run of the most-likely-to-occur amplitude, e.g., 0, followed by another amplitude. The coding includes assigning variable length codes, e.g., optimal codes such as Huffman codes or Arithmetic codes, to each event. In the description herein, 0 is assumed to be the most-likely-to-occur amplitude. The collecting or assuming statistics includes tracking the quantized non-zero-valued coefficient amplitudes and the number of zero-valued coefficients preceding the non-zero amplitude, i.e., tracking the runlengths of zeros which precedes any non-zero amplitude along a specified path, e.g., a zigzag scan path for a block of coefficients, e.g., an n by n coefficient block. Table 1 below shows by example the statistics tabulated as a two dimensional table:
TABLE 12D-VLC statisticsRunlength of preceding 0's0123456..Coeff. Amp.1S10S11S12S13S14S15S16..2S20S21S22S23S24S25S26..3S30S31S32S33S34535S36..4S40S41S42S43S44545S46..5S50S51S52S53S54S55S56..6S60S61S62S63S64S65S66..7S70S71S72S73S74S75S76..8S80S81S82S83S84S85S86..9S90S91S92S93S94S95S96................................
In the table, Sij is the likelihood expressed, for example, as a relative number of occurrences of an amplitude of i, i=1, 2, . . . occurring after a run of j 0's, j=0, 1, 2, . . . .
A variable length code such as an optimal code is then assigned to each of the events that have an Sij above, with the most-likely-to-occur element—typically S10 for the case of encoding a block of transform coefficients in transform coding—having the shortest number of bits, and the least occurring event coded using the longest number of bits. Table 2 below shows an example of a 2D-VLC table:
TABLE 22D-VLC statisticsRunlength of preceding 0's0123456..Coeff. Amp.1C10C11C12C13C14C15C16..2C20C21C22C23C24C25C26..3C30C31C32C33C34535C36..4C40C41C42C43C44545C46..5C50C51C52C53C54C55C56..6C60C61C62C63C64C65C66..7C70C71C72C73C74C75C76..8C80C81C82C83C84C85C86..9C90C91C92C93C94C95C96................................where Cij is the codeword used to encode the event of the combination of j consecutive 0-valued coefficients followed by a single non-zero coefficient of amplitude i, j=0, 1, . . . and i=1, 2, . . . .
2D-VLC is used in common transform coding methods such as JPEG, MPEG1, MPEG2, ITU-T-261, etc., as follows. For motion video, an image is divided into blocks, e.g., 8 by 8 or 16 by 16 blocks. Each image is classified as interframe or intraframe. Interframe images are typically post motion compensation. The blocks of the image are transformed and the transform coefficients are quantized. The quantized transform coefficients are then coded along a specified path according to a 2D-VLC table. Typically, interframe and intraframe images have different 2D-VLC tables. The DC component is typically separately encoded. Furthermore, the 2D-LVLC table may be truncated so that the least frequently occurring events use an escape code followed by a fixed length code. A special “EOB” code is used to indicate the end of block when all remaining coefficients are zero.
Still images are similarly encoded, e.g., in the same manner as an intraframe image for motion video.
FIG. 1 shows how a table lookup may be used to implement a 2D-VLC scheme. Prior to the table look up, the runlength of zero amplitudes preceding any non-zero amplitude and the non-zero amplitude are determined. The table look up uses a 2D table for those likely events encoded using variable length encoding. An escape code together with a fixed length codes is used for relatively less likely-to-occur combinations
The advantage of 2D_VLC is that both the position of each non-zero-valued coefficient as indicated by the runlength, and the quantized amplitude value are coded simultaneously as a pair using one 2D-VLC table. This may result in shorter codes, i.e., codes that use fewer bits than using separate VLC tables for each non-zero-valued coefficient and for its amplitude.
Because of the widespread use of image coding, many patents have been issued on different forms of VLC. U.S. Pat. No. 4,698,672 issued Oct. 6, 1987 to Wen-hsiung Chen, one of the inventors of the present invention, for example described one form of a two-dimensional variable length coding method.
Extensions and variations to the common 2D-VLC method are known. For example, the ITU H.263 compression standard defines one such variation sometimes called three-dimensional VLC (3D-VLC). See PCT patent publication WO 9318616 published Sep. 16, 1993 titled PICTURE DATA ENCODING METHOD and also the ITU-T H.263 standard. In 3D-VLC, each symbol (“event”) is a tripilet (LAST, RUN, LEYEL) that includes: LAST, a binary flag that indicates whether or not the current non-zero amplitude-value is the last non-zero coefficient in the block, RUN, the run-length of zero-value coefficients that precede the current non-zero amplitude, i.e., the number of zeroes since the last non-zero coefficient amplitude, and LEVEL, the current non-zero coefficient amplitude value. Thus, there is no need for a separate EOB codeword; whether or not the non-zero coefficient is the last one is incorporated into the event.
FIG. 2 shows how a table lookup may be used to implement 3D-VLC.
One deficiency of 2-D VLC methods is that every non-zero-valued coefficient needs to be accompanied by one runlength to identify its position. In block based transform coding, it may occur that there are a number of consecutive non-zero-valued coefficients along the pre-determined coding path. This may especially occur in intraframe coding and high bit rate interframe coding. The 2D-VLC method requires a separate runlength code, e.g., C10, C20, C30 . . . , etc., for each of the consecutive non-zero coefficient. Thus there is a need in the art for a method that provides for efficiently encoding a sequence of consecutive non-zero coefficient values.
Above-mentioned U.S. patent application Ser. No. 10/342,537 to inventors Chen et al., filed Jan. 15, 2003 and titled AN EXTENSION OF TWO-DIMENSIONAL VARIABLE LENGTH CODING FOR IMAGE COMPRESSION describes the “Extended 2D-VLC Method” that includes encoding repetitions of some non-zero coefficient values.
One variant of the Extended 2D-VLC method provides codes for all the possible amplitude variations of consecutive coefficients that follow a set of zero-valued coefficients. This effectively reduced the runlength to 1 for all cases. The difficulty of this approach is that there are enormous numbers of patterns that can be generated from the amplitudes of consecutive coefficients. For example, with 32 quantization levels as defined in many common video coding standards, there are in the order of 32n patterns that can be generated from n consecutive coefficients. As such, in practical implementation, only a limited number of most frequently appeared non-zero amplitude values such as 1 and 2 and limited number of lengths of consecutive non-zero-values, such as 3 or 4 consecutive values are regrouped for pattern matching.
Thus, there still may be inefficiency in using the called “Extended 2D-VLC Method’ in practice.
Thus there still is a need in the art for a method that includes efficiently encoding runs of non-zero-valued coefficients that may occur in series of transform coefficients of blocks of an image.
One or more patents describing some existing 2D-VLC coding methods have recently been the subject of patent litigation. Thus, there is a need in the art for alternate methods that can replace commonly used 2D-VLC methods that have been the subject of such litigation.